package com.xuxueli.api.service;

import com.xuxueli.api.exception.JobException;
import com.xuxueli.api.service.tenantjob.AsyncInitAddStartData;
import com.xuxueli.api.service.tenantjob.TenantJobInfo;

import java.util.List;

/**
 * description:
 * <p>
 * Date: 2019-04-30
 * <p>
 * Time: 11:31
 *
 * @author zhangxin
 */
public interface TenantJobService {

    public static final String MAPPING = "/api";

    /**
     * 批量保存并启动租户job
     *
     * @param infos
     *          服务请求，不能为空
     *
     * @return job对象id列表
     *
     * @throws JobException
     *          job异常
     */
    List<String> batchAddStart(List<TenantJobInfo> infos) throws JobException;

    /**
     * 异步初始化保存并启动定时任务
     *
     * <p>
     *     根据参数不同保存多个定时任务
     * </p>
     *
     * @param data
     *          请求数据对象
     *
     * @return 响应结果
     *
     * @throws JobException
     *          job异常
     */
    Boolean asyncInitAddStart(AsyncInitAddStartData data) throws JobException;


}
